import Fingerprint2 from 'fingerprintjs2'
import { ua } from './ua'
import { bus } from './bus'
import { http } from './http'
import { storage, cookie, session } from './storage'

const fingerprint = () => Fingerprint2.get({
    excludes: {
        audio: true,
        fontsFlash: true,
        webgl: true,
        canvas: true,
        enumerateDevices: true
    }
}, (components: any) => {
    let values = components.map((component: any) => {
        return component.value
    });
    let uuid = Fingerprint2.x64hash128(values.join(''), 31)
    localStorage.setItem("uuid", uuid)
});

export { fingerprint, ua, bus, http, storage, cookie, session }